package com.example.demo.service.serviceImpl;

import com.example.demo.mapper.WalletLogMapper;
import com.example.demo.mapper.WalletMapper;
import com.example.demo.pojo.Wallet;
import com.example.demo.pojo.WalletLog;
import com.example.demo.service.WalletLogService;
import com.example.demo.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WalletLogServiceImpl implements WalletLogService {
    @Autowired
    private WalletMapper walletMapper;
    @Autowired
    private WalletLogMapper walletLogMapper;
    @Override
    public Result getDetailed() {
        //先获取账户id
        Long accountId=1l;
        //根据账户id查询钱包
        Wallet wallet = walletMapper.get(accountId);
        //根据二者查询是 日志
        List<WalletLog> walletLogList=walletLogMapper.select(accountId,wallet.getId());
        return Result.success(walletLogList);
    }
}
